package com.jiang.jetpackdemo.database

import androidx.room.*
import com.jiang.jetpackdemo.model.FavoritesModel

@Dao
interface FavoritesModelDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insert(vararg favoritesModel: FavoritesModel)

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insertAll(list: MutableList<FavoritesModel>)

    @Delete
    suspend fun delete(vararg favoritesModel: FavoritesModel)

    @Query("select * from FavoritesModel")
    suspend fun queryAll(): MutableList<FavoritesModel>
}